home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 15 / CU Amiga Magazine's Super CD-ROM 15 (1997)(EMAP Images)(GB)[!][issue 1997-10].iso / CUCD / Graphics / Ghostscript / source / fonts.txt < prev    next >
Encoding:
Text File  |  1997-01-31  |  20.6 KB  |  483 lines

  1.    Copyright (C) 1990, 1995, 1996, 1997 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17.  
  18. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  19.  
  20. This file, fonts.txt, describes the fonts and font facilities supplied
  21. with Ghostscript.
  22.  
  23. For an overview of Ghostscript and a list of the documentation files, see
  24. README.
  25.  
  26. About Ghostscript fonts
  27. =======================
  28.  
  29. Most of the font files supplied with Ghostscript have a .pfb extension; a
  30. few have a .pfa or .gsf extension.  Each file defines one (transformable)
  31. font specified in outline form.  They are ordinary Type 1 PostScript outline
  32. fonts, and can be given to any PostScript language interpreter.  Files with
  33. .pfa or .pfb extension are also compatible with Adobe Type Manager and with
  34. tools that don't include a full PostScript language interpreter; files with
  35. .gsf extension are not compatible with ATM or other tools.  Starting with
  36. release 4.0, Ghostscript configurations compiled with the `ttfont' option
  37. can also use TrueType fonts (.ttf), but since Ghostscript's TrueType
  38. rasterizer currently ignores the `hints', the output is not of very good
  39. quality.
  40.  
  41. The only other font-related file that Ghostscript needs for proper operation
  42. is a file called Fontmap.  This file maps font names (such as /Times-Roman)
  43. to font file names (such as n021003l.pfb) or aliases (such as
  44. NimbusNo9L-Regu).
  45.  
  46. The free fonts supplied with Ghostscript fall into three groups:
  47.  
  48.     - 35 basic PostScript fonts (Times, Helvetica, Courier, Symbol,
  49.     etc.)  These are commercial-quality Type 1 fonts.  See the file
  50.     `Fontmap' for the complete list.
  51.  
  52.     - Fonts derived from the public domain Hershey fonts, with
  53.     improvements (such as adding accented characters) by Thomas Wolff.
  54.     These are quite different from traditional printer or display fonts;
  55.     the file `hershey.txt' describes them in more detail.
  56.  
  57.     - A few miscellaneous fonts including Cyrillic and kana fonts.
  58.  
  59. The 35 basic fonts are normally distributed in a file called
  60. `ghostscript-fonts-std-N.NN.tar.gz', the rest in a file called
  61. `ghostscript-fonts-other-N.NN.fonts.tar.gz'.
  62.  
  63. The file gs_fonts.ps, which is loaded as part of Ghostscript initialization,
  64. arranges to load fonts on demand using the information from Fontmap.  If you
  65. want to preload all of the known fonts, invoke the procedure
  66.     loadallfonts
  67. This is not done by default, since the fonts occupy about 50K each and there
  68. are a lot of them.
  69.  
  70. If you want to try out the fonts, prfont.ps contains code for printing a
  71. sampler.  Load this program, by including it in the gs command line or by
  72. invoking
  73.     (prfont.ps) run
  74. and then to produce a sampler of a particular font, invoke
  75.     /fontName DoFont
  76. e.g.
  77.     /Times-Roman DoFont
  78.  
  79. About the Kanji fonts
  80. ---------------------
  81.  
  82. Mr. Tetsurou Tanaka of the Department of Engineering, University of Tokyo,
  83. has created a set of free Kanji fonts that is freely available on the
  84. Internet for anonymous FTP from moe.ipl.t.u-tokyo.ac.jp:/Font and is
  85. distributed with Ghostscript.  Anyone can use these fonts as they are or
  86. with some format translation, and redistribute them without reporting.  If
  87. you redistribute them, you must inform the recipient that he can get the
  88. original from the abovementioned FTP site, so that he could get the newest
  89. version later.
  90.  
  91. The fonts include a README file in Japanese.  Here is some English
  92. documentation supplied by Mr. Kiyotaka Sakai, also of the University of
  93. Tokyo.
  94.  
  95.     The following four fonts are different styles of the same characters
  96.     (JISX208). These fonts also needs wadalab-sym.tar.Z in common.
  97.  
  98.     wadalab-mincho-0-8.tar.gz
  99.     wadalab-mincho-0-12.6.tar.gz
  100.     wadalab-gothic-0-13.5.tar.gz
  101.     wadalab-maru-0-8.4.tar.gz
  102.  
  103.     And the following two fonts are the other different styles of the same
  104.     characters(JISX0212).
  105.  
  106.     wadalab-mincho-1-8.tar.gz
  107.     wadalab-maru-1-8.tar.gz
  108.  
  109.     These fonts are postscript(type1) fonts. You can convert them to
  110.     Metafont, Type1(PFA) font, TeX font(for japanese TeX), BDF font,
  111.     Shotaikurabu font by using wftomf.c, wftopfa.c, wftodm.c, bdfmerge.c
  112.     wftovf.c in tools directory.
  113.  
  114. In order to conform to MS-DOS naming restrictions, we have renamed the
  115. original font files as follows:
  116.     Name        Original name
  117.     ----        -------------
  118.     got013-5.taz    wadalab-gothic-0-13.5.tar.gz
  119.     mar08-4.taz    wadalab-maru-0-8.4.tar.gz
  120.     mar18.taz    wadalab-maru-1-8.tar.gz
  121.     min012-6.taz    wadalab-mincho-0-12.6.tar.gz
  122.     min08-4.taz    wadalab-mincho-0-8.4.tar.gz
  123.     min18.taz    wadalab-mincho-1-8.tar.gz
  124.     sym-4.taz    wadalab-sym.4.tar.gz
  125.  
  126. Platform fonts
  127. ==============
  128.  
  129. Starting with release 2.6.1, Ghostscript uses whatever font technology is
  130. provided by the system on which it runs, by using the system's API for
  131. displaying text.  On MS Windows this may be TrueType, or it may be ATM;
  132. Ghostscript neither knows nor cares.
  133.  
  134. The PostScript language specifies that fonts are data structures with
  135. particular contents (e.g., they include a bounding box for the font, an
  136. Encoding vector for specifying the character set, etc.), and it is fairly
  137. common for PostScript files to make use of this fact; also, characters can
  138. be used as clipping regions, and can be arbitrarily rotated, skewed,
  139. expanded/condensed, etc. algorithmically.  Most of this information is
  140. available in one form or another from the underlying graphics system, but
  141. one crucial piece is not: the actual scalable outlines of the characters,
  142. which Ghostscript needs in order to implement clipping with character
  143. shapes and to implement arbitrarily transformed characters.  Consequently,
  144.  
  145.     Ghostscript needs the scalable outlines of any font mentioned
  146.     in a document, and will load them from the disk (.PFA, .PFB, or
  147.     .GSF file) in the usual way, even if it uses the platform's font
  148.     machinery for displaying the characters.
  149.  
  150. To make matters worse, platforms use different names for their standard
  151. fonts.  For example, the Times Roman font, for which PostScript files use
  152. the name "Times-Roman", may be known as "Times-Roman", "Times Roman", "Tms
  153. Rmn", "Times New Roman", or "TimesNewRoman".  The name may even be
  154. completely different: the usual Helvetica-equivalent TrueType font is
  155. called "Arial".  Now, it is possible to cope with this situation by
  156. introducing aliases in Fontmap, but there are two reasons why the
  157. current Ghostscript release does not do this:
  158.  
  159.     1) Naming in different systems is so unstandardized that there
  160. does not seem to be a small set of alternative names that is likely to
  161. cover most of the situations.  All 5 of the above names for Times Roman
  162. have been seen in Windows and OS/2 environments, depending on system
  163. version, TrueType vs.  ATM, and other unknown factors.
  164.  
  165.     2) Each alias takes up a substantial amount of space (several
  166. hundred bytes) at run time.  If each of the standard 35 fonts has 3
  167. additional aliases, this might amount to 50K of wasted space.  This is a
  168. lot on a PC, although running under Windows in enhanced mode, it might not
  169. be a problem.
  170.  
  171. If you don't seem to be getting nice characters on the screen under MS
  172. Windows, you can try adding aliases to the Fontmap, according to the
  173. documentation found there.
  174.  
  175. Adding your own fonts
  176. =====================
  177.  
  178. Ghostscript can use any Type 0, Type 1, Type 3, Type 4, or Type 42 font that
  179. is acceptable to other PostScript language interpreters or to ATM, including
  180. MultiMaster fonts.  Starting with release 4.0, Ghostscript can also use
  181. TrueType fonts (if Ghostscript was compiled with the `ttfont' option).
  182. Ghostscript also provides a way to construct a (low-quality) Type 1 font
  183. from a bitmap font in BDF format, which is a popular format in the Unix
  184. world.
  185.  
  186. If you want to add fonts of your own, you must edit Fontmap to include an
  187. entry for your new font at the end.  The format for entries is documented
  188. in the Fontmap file.  Since later entries in Fontmap override earlier
  189. entries, any fonts you add will supersede the corresponding fonts supplied
  190. with Ghostscript.
  191.  
  192. In the PC world, Type 1 fonts are customarily given names ending in .PFA or
  193. .PFB.  Ghostscript can use these directly; you just need to make the entry
  194. in Fontmap.  If you are going to use a commercial Type 1 font (such as fonts
  195. obtained in conjunction with Adobe Type Manager) with Ghostscript, please
  196. read carefully the license that accompanies the font; Aladdin Enterprises
  197. takes no responsibility for any possible violations of such licenses.  The
  198. same applies to TrueType fonts, whose names customarily end in .TTF.
  199.  
  200. Converting BDF fonts
  201. --------------------
  202.  
  203. If you want to convert a BDF file to a scalable outline, use the program
  204. bdftops.ps (and invoking shell script bdftops.bat or bdftops).  Run the
  205. shell command
  206.     bdftops <BDF_file_name> [<AFM_file1_name> ...] <your_gsf_file_name>
  207.       <font_name> <uniqueID> [<XUID>] [<encoding_name>]
  208. e.g.,
  209.     bdftops pzdr.bdf ZapfDingbats.afm pzdr.gsf
  210.       ZapfDingbats 4100000 1000000.1.41
  211. (Obviously, you would enter this all on one line; the example is split so
  212. it will fit on the page.)  Then make an entry for the .gsf file in Fontmap
  213. as described above.  See the end of this document for more detail.
  214.  
  215. For developers only
  216. ===================
  217.  
  218. The rest of this document is very unlikely to be of value to ordinary
  219. users.
  220.  
  221. Contents of fonts
  222. -----------------
  223.  
  224. As noted above, Ghostscript accepts fonts in the same formats as PostScript
  225. interpreters.  Type 0, 1, and 3 fonts are documented in the PostScript
  226. Language Reference Manual (Second Edition); detailed documentation for Type
  227. 1 fonts appears in a separate Adobe book.  Type 42 (encapsulated TrueType)
  228. fonts are documented in an Adobe supplement; the TrueType format is
  229. documented in publications available from Apple and Microsoft.  Type 4 fonts
  230. are not documented anywhere; they are essentially Type 1 fonts with a
  231. BuildChar or BuildGlyph procedure.
  232.  
  233. Precompiling fonts
  234. ------------------
  235.  
  236. You can compile any Type 1 font into C and link it into the Ghostscript
  237. executable.  (Type 1 fonts include any font whose name ends with .pfa or
  238. .pfb, and it also includes all the Ghostscript .gsf fonts except for the
  239. Hershey fonts.)  This doesn't have any effect on rendering speed, but it
  240. eliminates the time for loading the font dynamically, which may make a big
  241. difference in total rendering time, especially for multi-page documents.
  242. Fonts that have been precompiled and linked in this way do not need to
  243. appear in the Fontmap, although if they do appear there, no harm is done.
  244.  
  245. The utility for precompiling fonts is called font2c.  Note that font2c is
  246. a PostScript language program, so you must have Ghostscript already
  247. running to be able to run font2c; you must also have entries in the
  248. Fontmap for the fonts you want to compile.  For example, to precompile
  249. the Times-Italic font,
  250.     font2c Times-Italic ptmri.c
  251. where the first argument is the font name and the second is the name of
  252. the .c file.  You can use any file name you want, as long as it ends in
  253. .c.  It doesn't have to be limited to 8 characters, unless your operating
  254. system requires this.  We suggest that you use names xxxx.c, where
  255. xxxx.gsf or xxxx.pfa is the name of the font file in the Fontmap file,
  256. just so you don't have to keep track of another set of names.  (If you are
  257. running on a VMS platform, or another platform where the C compiler has a
  258. limit on the length of identifiers, you must do something slightly more
  259. complicated; see the section 'Platforms with identifier length limits'
  260. below.  Also, on VMS, you must put quotes "" around the font name so that
  261. the VMS command processor doesn't convert the name to lower case.)
  262.  
  263. For VMS environments, see the directions in the file make.txt, and ignore
  264. the rest of this section.
  265.  
  266. Note that ncrr.c, ptmr.c, etc. are not supplied with the Ghostscript
  267. fileset, since they are quite large and can easily be recreated using the
  268. font2c program as described above.  There is a makefile called cfonts.mak
  269. that will run font2c on all the fonts supplied with Ghostscript.  Invoke it
  270. with
  271.     make -f cfonts.mak
  272. On some systems, you may have to omit the space following the -f, i.e.,
  273.     make -fcfonts.mak
  274.  
  275. Besides running font2c, you must arrange things so that the fonts will be
  276. compiled, and linked into the executable.  To do this, add the compiled
  277. fonts "feature" to your platform-specific makefile.  On MS-DOS systems, you
  278. edit tc.mak, bc.mak, bcwin.mak, msc.mak, or watc.mak; on Unix systems, you
  279. edit ansihead.mak, cc-head.mak, or gcc-head.mak, and then execute tar_cat.
  280. Find the definition of the FEATURE_DEVS macro in the makefile, e.g.,
  281.     FEATURE_DEVS=level2.dev pdf.dev
  282. and add ccfonts.dev, e.g.,
  283.     FEATURE_DEVS=level2.dev pdf.dev ccfonts.dev
  284.  
  285. Next, you must add the specific fonts to the generic makefile.  On MS-DOS
  286. systems, you edit gs.mak; on Unix systems, you edit makefile.  The makefile
  287. already has rules for the standard 35 fonts supplied with Ghostscript.
  288. Find the line in the relevant makefile that says
  289.     #ccfonts1_=<something>
  290. Remove the # mark from this line, and from all the following lines down to
  291. and including the one that says
  292.     #ccfonts9=<something>
  293. This is all you need to do for the standard fonts.  The next couple of
  294. paragraphs describe how to compile in other fonts, such as the Utopia or
  295. Kana fonts or your own fonts.
  296.  
  297. Suppose you want to compile the Kana fonts into the executable.  First,
  298. pick one of ccfonts10 through 15 as the place you will do this, say
  299. ccfonts10.  Add your compiled font file names, e.g.,
  300.     ccfonts10_=fhirw.$(OBJ)
  301. If the line gets too long, use another line of the same form, e.g.,
  302.     ccfonts11_=fkarw.$(OBJ)
  303. Just below this, you will find a line that says
  304.     ccfonts10_=
  305. Add your own fonts to the end of this line, e.g.,
  306.     ccfonts10=Calligraphic_Hiragana
  307. Notice that you must replace `-' by `_' in the font name.  Again, if
  308. the line gets too long, add another line of the same form, e.g.,
  309.     ccfonts10=Calligraphic_Hiragana
  310.     ccfonts11=Calligraphic_Katakana
  311.  
  312. After all the lines of this form, add a pair of lines to compile each font,
  313. separating these entries from the ccfonts* lines and from each other by a
  314. blank line.  In our example:
  315.  
  316.     fhirw.$(OBJ): fhirw.c $(CCFONT)
  317.         $(CCCF) fhirw.c
  318.  
  319.     fkarw.$(OBJ): fkarw.c $(CCFONT)
  320.         $(CCCF) fkarw.c
  321.  
  322. Finally, run `make'.  The executable will now include the fonts you added.
  323. They will be present in FontDirectory when Ghostscript starts up.
  324.  
  325. Precompiling fonts on platforms with identifier length limits
  326. -------------------------------------------------------------
  327.  
  328. On some platforms, the C compiler and/or linker have a limit on the number
  329. of significant characters in an identifier.  On such platforms, you must
  330. do a little extra work.
  331.  
  332. Let N be the maximum number of significant characters in an identifier
  333. (typically 31).  For each font whose name is longer than N-5 characters,
  334. pick an arbitrary identifier that we will call the "short name".  This can
  335. be any string you want, as long as it contains only letters, digits, and
  336. underscores; is no longer than N-5 characters; and is not the same as any
  337. other font name or short name.  A good choice for this would be to use the
  338. name of the C file.  (There is no harm in doing this for fonts with names
  339. shorter than N-5 characters, it's just not necessary.)
  340.  
  341. You must do two different things for fonts that require a short name.
  342. First, you must supply the short name as a third argument to the font2c
  343. program.  For example, to compile NewCenturySchlbk-BoldItalic using the
  344. short name "pncbi",
  345.     font2c NewCenturySchlbk-BoldItalic pncbi.c pncbi
  346. Then when you add the font to the gsaddmod line in the makefile, use the
  347. short name, not the actual font name, e.g.,
  348.     ccfonts2=pncbi
  349. instead of
  350.     ccfonts2=NewCenturySchlbk_BoldItalic
  351. Everything else is as described above.
  352.  
  353. This procedure doesn't change the name of the font in the Fontmap, or as
  354. seen from within Ghostscript; it's just a workaround for a limitation of
  355. some older compilers.
  356.  
  357. Font names and unique IDs
  358. -------------------------
  359.  
  360. If you create your own fonts, and are only going to use them within your own
  361. organization, you should use UniqueID values between 4000000 and 4999999 as
  362. described just below; if you are going to distribute fonts, call Adobe and
  363. get them to assign you some UniqueIDs and also an XUID for your
  364. organization.  The current (September 1993) UniqueID Coordinator is Terry
  365. O'Donnell; he is very helpful and will probably be able to assign you the
  366. numbers over the phone.
  367.  
  368. The suggested temporary UniqueID for a font looks like:
  369.     4TTWVE0
  370. where
  371.     TT is a two-digit number representing the typeface,
  372.     W represents the weight (normal, bold, ...),
  373.     V represents the variant (normal, italic, oblique, ...), and
  374.     E represents the expansion (normal, condensed, ...).
  375. This scheme will not work forever.  As soon there are more 99 typefaces, or
  376. more than 9 weights or variants, we will have to do something else. But it
  377. suffices for the near future.
  378.  
  379. XUIDs are a Level 2 PostScript feature that serves the same function as
  380. UniqueIDs, but is not limited to a single 24-bit integer.  The bdftops
  381. program creates XUIDs of the form [-X- 0 -U-] where -X- is the organization
  382. XUID and -U- is the UniqueID.  (Aladdin Enterprises' organization XUID is
  383. 107; do not use this for your own fonts that you distribute.)
  384.  
  385. Ghostscript fonts are stored on files, and the file names must comply
  386. with the 8-character limit imposed by MS-DOS and other operating systems.
  387. We therefore construct the filename for a font in a way somewhat similar to
  388. the construction for temporary UniqueIDs:
  389.     FTTWVVVE.gsf
  390. where F is the foundry, TT a two-letter abbreviation for the typeface, and
  391. W, V, and E the weight, variant, and expansion.  Since a font can have
  392. multiple variants, we allocate three letters to that (for example, Lucida
  393. Regular Sans Typewriter Italic).  If a font has four variants, you're on
  394. your own.  If a font does have multiple variants, it's best to add the
  395. expansion letter `r', so that it is clear which letters are variants and
  396. which the expansion.
  397.  
  398. This scheme is very close to the one proposed in `Filenames for fonts',
  399. published in the first 1990 issue of TUGboat (the journal of the TeX Users
  400. Group).
  401.  
  402. In the following tables, we made no attempt to be exhaustive.  Instead, we
  403. have simply allocated entries for those things that we needed for the fonts
  404. that we are actually distributing.
  405.  
  406. foundries:
  407. ----------
  408. b = Bitstream
  409. f = freely distributable/public domain fonts
  410. n = IBM
  411. p = Adobe (`p' for PostScript)
  412. u = URW[++]
  413.  
  414. typefaces:
  415. id   name              filename prefix
  416. ----------------------------------------------------------------
  417. 08 = Avant Garde        = pag        (Adobe)
  418. 11 = Bookman            = pbk        (Adobe)
  419. 01 = CharterBT            = bch        (Bitstream)
  420. 02 = Courier            = ncr        (IBM)
  421. 03 = Helvetica            = phv        (Adobe)
  422. 04 = New Century Schoolbook    = pnc        (Adobe)
  423. 09 = Palatino            = ppl        (Adobe)
  424. 05 = Symbol            = psy        (Adobe)
  425. 06 = Times            = ptm        (Adobe)
  426. --   Utopia            = put        (Adobe)
  427. 07 = Zapf Chancery        = zc        (public domain)
  428. 10 = Zapf Dingbats        = pzd        (Adobe)
  429. 12 = public domain Cyrillic    = fcy        (public domain)
  430. 13 = Kevin Hartig Hiragana    = fhi        (shareware)
  431. 14 = Kevin Hartig Katakana    = fka        (shareware)
  432.  
  433. 90 = Hershey Gothic English    = hrge
  434. 91 = Hershey Gothic Italian    = hrit
  435. 92 = Hershey Gothic German    = hrgr
  436. 93 = Hershey Greek        = hrgk
  437. 94 = Hershey Plain        = hrpl
  438. 95 = Hershey Script        = hrsc
  439. 96 = Hershey Symbol        = hrsy
  440.  
  441. weights:
  442. --------
  443. 0 = normal            = r
  444. 1 = bold            = b
  445. 2 = book            = k
  446. 3 = demi            = d
  447. 4 = light            = l
  448.  
  449. variants:
  450. ---------
  451. 0 = normal            = r (omitted when the weight is normal)
  452. 1 = italic            = i
  453. 2 = oblique            = o
  454. 3 = script/handwritten/swash    = w
  455.  
  456. expansions:
  457. -----------
  458. 0 = normal            = r (omitted when the weight and variant
  459.                                    are normal)
  460. 1 = narrow            = n
  461.  
  462. Converting BDF fonts to .gsf (Type 1) fonts
  463. -------------------------------------------
  464.  
  465. The bdftops conversion program takes the following arguments:
  466.  
  467.     bdftops xx.bdf [yy1.afm ...] zz.gsf fontname UniqueID [XUID]
  468.       [encodingname]
  469.  
  470. These arguments have the following meanings:
  471.  
  472.     xx.bdf - the input bitmap file, a BDF file
  473.     yy*.afm - the AFM files giving the metrics (optional)
  474.     zz.gsf - the output file
  475.     fontname - the font name
  476.     UniqueID - the UniqueID, as described above
  477.     XUID - the XUID, in the form n1.n2.n3... (optional)
  478.     encodingname - the encoding for the font (optional)
  479.  
  480. Currently, the defined encodings are StandardEncoding, ISOLatin1Encoding,
  481. SymbolEncoding, and DingbatsEncoding. If the encoding is omitted,
  482. StandardEncoding is assumed.
  483.